import { createRouter, createWebHistory } from 'vue-router'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/home',
      redirect: '/home/Workbench',
    },
    {
      path: '/',
      name: 'welcome',
      component: () => import('../views/Community.vue'),
    },
    {
      path: '/home',
      name: 'home',
      meta: {
        title: '首页'
      },
      component: () => import('@/views/Home.vue'),
      children: [
        {
          path: '/home/Workbench',
          name: 'Workbench',
          meta: {
            title: '工作台',
          },
          children: [
            {
              path: '/home/Workbench',
              name: 'Workbench',
              meta: {
                title: '工作台',
              },
              component: () => import('@/views/Home/WorkBench/Workbench.vue'),

            }
          ]
        },
        {
          path: '/home/admindata',
          name: 'admindata',
          meta: {
            title: '资料管理',
          },
          children: [
            {
              path: '/home/admindata',
              name: 'admindata',
              meta: {
                title: '小区信息',
              },
              component: () => import('@/views/Home/AdminData.vue'),
            },
            {
              path: '/home/adminfloor',
              name: 'adminfloor',
              meta: {
                title: '楼座管理',
              },
              component: () => import('@/views/Home/AdminFloor.vue'),
            },
            {
              path: '/home/adminhousing',
              name: 'adminhousing',
              meta: {
                title: '房屋管理',
              },
              component: () => import('@/views/Home/AdminHousing.vue'),
            },
            {
              path: '/home/storeroom',
              name: 'storeroom',
              meta: {
                title: '储物室管理',
              },
              component: () => import('@/views/Home/AdminStoreroom.vue'),
            },
            {
              path: '/home/household',
              name: 'household',
              meta: {
                title: '住户管理',
              },
              component: () => import('@/views/Home/AdminHousehold.vue'),
              children: [
                {
                  path: '/home/Workbench/approval',
                  name: 'approval',
                  meta: {
                    title: '审批'
                  },
                  component: () => import('@/views/Home/WorkBench/Approval.vue')
                },
                {
                  path:'/home/workbench/add',
                  name:'add',
                  meta: {
                    title: '新建住户'
                  },
                  component: () => import('@/views/Home/householdAdd.vue')
                }
              ]
            },
            {
              path: '/home/rental',
              name: 'rental',
              meta: {
                title: '房屋租赁管理',
              },
              component: () => import('@/views/Home/AdminRental.vue')
            }
          ]
        },
        {
          path: '/home/caradmin',
          name: 'caradmin',
          meta: {
            title: '车行管理',
          },
          children: [
            {
              path: '/home/area',
              name: 'area',
              meta: {
                title: '区域管理',
              },
              component: () => import('@/views/Home/CarAdmin/AreaAdmin.vue')
            },
            {
              path: '/home/parking',
              name: 'parking',
              meta: {
                title: '车位管理',
              },
              component: () => import('@/views/Home/CarAdmin/ParkingAdmin.vue')
            },
            {
              path: '/home/vehicles',
              name: 'vehicles',
              meta: {
                title: '车辆管理',
              },
              component: () => import('@/views/Home/CarAdmin/VehiclesAdmin.vue')
            },
            {
              path: '/home/monthcard',
              name: 'monthcard',
              meta: {
                title: '月卡管理',
              },
              component: () => import('@/views/Home/CarAdmin/MonthcardAdmin.vue')
            },
            {
              path: '/home/carpayment',
              name: 'carpayment',
              meta: {
                title: '停车缴费管理',
              },
              component: () => import('@/views/Home/CarAdmin/CarPaymentAdmin.vue')
            }
          ]
        },
        {
          path: '/home/property',
          name: 'property',
          meta: {
            title: '物业服务',
          },
          children: [
            {
              path: '/home/repair',
              name: 'repair',
              meta: {
                title: '报修管理',
              },
              component: () => import('@/views/Home/Property/RepairAdmin.vue')
            },
            {
              path: '/home/visitors',
              name: 'visitors',
              meta: {
                title: '访客管理',
              },
              component: () => import('@/views/Home/Property/VisitorsAdmin.vue')
            },
            {
              path: '/home/complaints',
              name: 'complaints',
              meta: {
                title: '投诉管理',
              },
              component: () => import('@/views/Home/Property/ComplaintsAdmin.vue')
            },
            {
              path: '/home/activities',
              name: 'activities',
              meta: {
                title: '活动管理',
              },
              component: () => import('@/views/Home/Property/ActivitiesAdmin.vue')
            },
            {
              path: '/home/notice',
              name: 'notice',
              meta: {
                title: '公告管理',
              },
              component: () => import('@/views/Home/Property/NoticeAdmin.vue')
            }
          ]
        },
        {
          path: '/home/charges',
          name: 'charges',
          meta: {
            title: '缴费管理',
          },
          children: [
            {
              path: '/home/bill',
              name: 'bill',
              meta: {
                title: '账单管理',
              },
              component: () => import('@/views/Home/Charges/BillAdmin.vue')
            },
            {
              path: '/home/feeitems',
              name: 'feeitems',
              meta: {
                title: '收费项目管理',
              },
              component: () => import('@/views/Home/Charges/FeeItemsAdmin.vue')
            },
            {
              path: '/home/meterreading',
              name: 'meterreading',
              meta: {
                title: '抄表周期管理',
              },
              component: () => import('@/views/Home/Charges/MeterReadingAdmin.vue')
            },
            {
              path: '/home/instrument',
              name: 'instrument',
              meta: {
                title: '仪表管理',
              },
              component: () => import('@/views/Home/Charges/InstrumentAdmin.vue')
            }
          ]
        },
        {
          path: '/home/patrol',
          name: 'patrol',
          meta: {
            title: '巡更巡检',
          },
          children: [
            {
              path: '/home/patroladmin',
              name: 'patroladmin',
              meta: {
                title: '巡更记录',
              },
              component: () => import('@/views/Home/Patrol/PatrolAdmin.vue')
            },
            {
              path: '/home/mission',
              name: 'mission',
              meta: {
                title: '巡更任务管理',
              },
              component: () => import('@/views/Home/Patrol/MissionAdmin.vue')
            },
            {
              path: '/home/plan',
              name: 'plan',
              meta: {
                title: '巡更计划管理',
              },
              component: () => import('@/views/Home/Patrol/PlanAdmin.vue')
            },
            {
              path: '/home/routeadmin',
              name: 'routeadmin',
              meta: {
                title: '巡更路线管理',
              },
              component: () => import('@/views/Home/Patrol/RouteAdmin.vue')
            },
            {
              path: '/home/project',
              name: 'project',
              meta: {
                title: '巡更项目管理',
              },
              component: () => import('@/views/Home/Patrol/ProjectAdmin.vue')
            }
          ]
        },
        {
          path: '/home/equipment',
          name: 'equipment',
          meta: {
            title: '设备管理',
          },
          children: [
            {
              path: '/home/publicadmin',
              name: 'publicadmin',
              meta: {
                title: '公共设备管理',
              },
              component: () => import('@/views/Home/Equipment/PublicAdmin.vue')
            },
            {
              path: '/home/classify',
              name: 'classify',
              meta: {
                title: '设备分类管理',
              },
              component: () => import('@/views/Home/Equipment/ClassifyAdmin.vue')
            },
            {
              path: '/home/maintenance',
              name: 'maintenance',
              meta: {
                title: '设备维修管理',
              },
              component: () => import('@/views/Home/Equipment/MaintenanceAdmin.vue')
            }
          ]
        },
        {
          path: '/home/set',
          name: 'set',
          meta: {
            title: '设置',
          },
          children: [
            {
              path: '/home/householdlabel',
              name: 'householdlabel',
              meta: {
                title: '住户标签',
              },
              component: () => import('@/views/Home/Set/Householdlabel.vue')
            },
            {
              path: '/home/complaintstype',
              name: 'complaintstype',
              meta: {
                title: '投诉类型',
              },
              component: () => import('@/views/Home/Set/ComplaintsType.vue')
            },
            {
              path: '/home/housingfacilities',
              name: 'housingfacilities',
              meta: {
                title: '房屋设施管理',
              },
              component: () => import('@/views/Home/Set/HousingfacilitiesAdmin.vue')
            },
            {
              path: '/home/banner',
              name: 'banner',
              meta: {
                title: '轮播图管理',
              },
              component: () => import('@/views/Home/Set/BannerAdmin.vue')
            },
            {
              path: '/home/staff',
              name: 'staff',
              meta: {
                title: '员工管理',
              },
              component: () => import('@/views/Home/Set/StaffAdmin.vue')
            },
            {
              path: '/home/role',
              name: 'role',
              meta: {
                title: '角色管理',
              },
              component: () => import('@/views/Home/Set/RoleAdmin.vue')
            },
            {
              path: '/home/messages',
              name: 'messages',
              meta: {
                title: '消息通知',
              },
              component: () => import('@/views/Home/Set/Messages.vue')
            },
            {
              path: '/home/setlog',
              name: 'setlog',
              meta: {
                title: '操作日志'
              },
              component: () => import('@/views/Home/Set/SetLog.vue')
            },
            {
              path: '/home/personalmessage',
              name: 'personalmessage',
              meta: {
                title: '个人信息',
              },
              component: () => import('@/views/Home/Set/PersonalMessage.vue')

            }
          ]
        }
      ]
    },
    {
      path: '/login',
      name: 'login',
      component: () => import('../views/Login/LoginPage.vue')
    },


  ]
})

export default router
